//
//  KLSGHotProgramCell.m
//  KaoLaShiGuangFM
//
//  Created by lanou3g on 15/10/28.
//  Copyright © 2015年 com.lanou3g. All rights reserved.
//

#import "KLSGHotProgramCell.h"

@implementation KLSGHotProgramCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addSubviews];
    }
    return self;
}
- (void)addSubviews
{
    self.figureLable = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 80)];
    self.figureLable.textAlignment = NSTextAlignmentCenter;
    self.figureLable.text = @"1";
    self.figureLable.font = [UIFont systemFontOfSize:22];
    [self.contentView addSubview:self.figureLable];
    
    self.coverImage = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.figureLable.frame), 10, 60, 60)];
    self.coverImage.layer.cornerRadius = self.coverImage.frame.size.width / 2;
    self.coverImage.layer.masksToBounds = YES;
    self.coverImage.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.coverImage];
    
    self.titleLable = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.coverImage.frame) + 10, 7, kScreenWidth / 2, 50)];
    self.titleLable.text = @"1";
    self.titleLable.font = [UIFont systemFontOfSize:15];
    self.titleLable.numberOfLines = 0;
    [self.contentView addSubview:self.titleLable];
    
    self.nickNameLable = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.coverImage.frame) + 10, CGRectGetMaxY(self.titleLable.frame) - 3, 100, 18)];
    self.nickNameLable.font = [UIFont systemFontOfSize:13];
    self.nickNameLable.alpha = kAlpha;
    [self.contentView addSubview:self.nickNameLable];
    
    self.downloadButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    self.downloadButton.frame = CGRectMake(kScreenWidth - 40, CGRectGetMaxY(self.titleLable.frame) - 15, 30, 30);
//    [self.downloadButton setBackgroundImage:[UIImage imageNamed:@"download"] forState:(UIControlStateNormal)];
    [self.contentView addSubview:self.downloadButton];
    
    UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.coverImage.frame) + 10, 79, kScreenWidth - 110, 1)];
    lineView.backgroundColor = [UIColor lightGrayColor];
    [self.contentView addSubview:lineView];
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
